package com.xiaodeng.xdblogspringboot.mapper;

import com.xiaodeng.xdblogspringboot.pojo.Category;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {
    //新增文章类别
    @Insert("insert into category (category_name, create_user, create_time, update_time)" +
            " values (#{categoryName},#{createUser},#{createTime},#{updateTime})")
    void addcategory(Category category);

    //  查询文章类别
    @Select("select * from category")
    List<Category> getCategory();
    @Delete("delete from category where id = #{id}")
    void delete(Integer id);
    @Update("update category set category_name = #{categoryName},update_time = #{updateTime}  where id = #{id}")
    void update(Category category);
}
